// import {dialog, Menu} from "electron";
const {electron,Menu,dialog} = require("electron");

 const  MainMenu = (args,callback)=>{
    return  Menu.buildFromTemplate([
         {label:'首页',
             submenu:[
                 {label:'111'},
                 {label:'222'},
                 {role:'copy'},
                 {role:'paste'},
                 {role:'redo'},
                 {role:'undo'},
             ]},
         {
             label:'系统动作',
             submenu:[
                 {
                     label: '调试工具',
                     role: 'toggleDevTools'
                 },
                 {
                     label: '切换全屏/窗口显示',
                     role: 'togglefullscreen'
                 },
                 {
                     label: '自定义事件',
                     click:()=>{
                         const  arraY = ['yes','no','meby']
                         dialog.showMessageBox({
                             title:'对话弹窗',
                             message:args,
                             detail:'请选择你要做的是',
                             buttons:arraY
                         }).then(({ response})=>{
                             // return arraY[response]
                             callback(arraY[response],'123')
                         })
                     },
                     accelerator:'Shift+Alt+G'//直接调用动作
                 }
             ]
         }
     ])
 }

module.exports = MainMenu
